﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using CommClass;
using DMS.CommClass;


namespace DMS
{
    public partial class Frmviewzhuanchu : DMS.FrmTemplate 
    {
       
      
        Report Rpt = new Report();
        MO mo = new MO(App.Ds);
      
      
        string kucuntiaozhengID = "";
        

        public Frmviewzhuanchu(string kucuntiaozhengID111 )            
        {
            InitializeComponent();

            kucuntiaozhengID = kucuntiaozhengID111;
            //主单
            DataTable dt =  mo.kucuntiaozheng(kucuntiaozhengID);
            if (dt.Rows.Count > 0)
            {
               label2.Text= dt.Rows[0]["shougongNumber"].ToString();
               label3.Text = dt.Rows[0]["OrderNumber"].ToString();
               label4.Text = dt.Rows[0]["UserName"].ToString();
               label5.Text = dt.Rows[0]["qianhedate"].ToString();
               label8.Text = dt.Rows[0]["tiaozhengleixingmiaoshu"].ToString();
               label12.Text = dt.Rows[0]["remark"].ToString();
                //明细
              this.dgvdo.DataSource = mo.kucuntiaozhengdetail(kucuntiaozhengID); 
            }


        }


        

        
     

        private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            //查看提单明细信息
           // int row = dgvdo.Rows[e.RowIndex].Index;
           // sedonumber = dgvdo.Rows[row].Cells[1].Value.ToString();//当前选定的提货单号
          //  FrmDoEntry form = new FrmDoEntry();
          //  form.ReDoNumber = sedonumber;
           // form.ShowDialog();
        }

       

      



        private void button6_Click_1(object sender, EventArgs e)
        {

        }

      

       

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;
            Rpt.SourceData = mo.kucuntiaozhengdetailprint(kucuntiaozhengID).DefaultView;
            Rpt.ReportName = @"Report\RptzhuanchuPrint.rdlc";
            Rpt.Parameters.Clear();
            // for (int i = 0; i < int.Parse(listBox1.SelectedValue.ToString()); i++)
            //  {
            Rpt.Print();
            //  }
            //Report Rpt1 = new Report();
            //Rpt1.SourceData = mo.GetVehilceEntry(mergenumber).DefaultView;
            //Rpt1.ReportName = @"Report\RptVehicleEntry.rdlc";

            //Rpt1.Print();
          
            
        }

       

        private void txtbProduct_TextChanged(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }


       // private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
     //   {

      //  }

    }
}
